home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / T / Think C dcmd 1.0.1.sit / Think C dcmd 1.0.1 ƒ / Think Put Lib source / __HexToText.c / __HexToText.c
Encoding:
Text File  |  1994-06-12  |  247 b   |  13 lines  |  [TEXT/KAHL]

  1. void __HexToText (unsigned long hex, char* str, short size  /* 0=word, 1=long */ )
  2. {
  3.         int         n, len;
  4.         char*     digits = "0123456789ABCDEF";
  5.     
  6.     len = size ? 8-1 : 4-1;
  7.     
  8.     for ( n = len; n >= 0; n-- )
  9.     {
  10.         str[n] = digits[hex % 16];
  11.         hex /= 16;
  12.     }
  13. }